package dancetiktokenumsredis

const (
	// 小程序游戏redis队列标识
	MiniGameRedisListTagChangeClothes       = 1 // 换服装
	MiniGameRedisListTagCancelRelation      = 2 // 解除关系
	MiniGameRedisListTagRoomEnterShowSwitch = 3 // 直播间大佬入场特效开关

	// 服务节点Ip
	TestServiceNodeOne   = "dance-tiktok-mini-game-test.9you.com" // test服务节点1
	DevServiceNodeOne    = "dance-tiktok-mini-game-dev.9you.com"  // dev服务节点1
	OnlineServiceNodeOne = "dance-tiktok-mini-game-1.9you.com"    // 线上服务节点1,47.122.25.197
	OnlineServiceNodeTwo = "dance-tiktok-mini-game-2.9you.com"    // 线上服务节点2,47.122.22.148

	TestServiceNodeOneTag   = "1" // test服务节点标识1
	DevServiceNodeOneTag    = "1" // dev服务节点标识1
	OnlineServiceNodeOneTag = "1" // 线上服务节点标识1
	OnlineServiceNodeTwoTag = "2" // 线上服务节点标识2

	// 环境标识
	TestEnvTag   = "test" // test
	DevEnvTag    = "dev"  // dev
	OnlineEnvTag = "pro"  // 线上

	RelationNo         = 0 // 默认,没有关系
	RelationMarried    = 1 // 挚友
	RelationEngagement = 2 // 密友
	RelationSoulMate   = 3 // 知己
	RelationBestFriend = 4 // 死党

	RoomEnterShowSwitchOpen = 0 // 显示
	RoomEnterShowSwitchOff  = 1 // 关闭
)

type ServiceNodeEnums struct {
}

var ServiceNodeEnumsObject ServiceNodeEnums

// ServiceNodeTagMap 节点标识列表Map
func (s ServiceNodeEnums) ServiceNodeTagMap() map[string][]string {
	EnvNodes := make(map[string][]string, 0)

	EnvNodes[TestEnvTag] = []string{
		TestServiceNodeOneTag,
	}

	EnvNodes[DevEnvTag] = []string{
		DevServiceNodeOneTag,
	}
	EnvNodes[OnlineEnvTag] = []string{
		OnlineServiceNodeOneTag,
		OnlineServiceNodeTwoTag,
	}
	return EnvNodes
}

// ServiceNodesMap 节点列表Map
func (s ServiceNodeEnums) ServiceNodesMap() map[string]map[string]string {
	EnvNodes := make(map[string]map[string]string, 0)

	EnvNodes[TestEnvTag] = make(map[string]string, 0)
	EnvNodes[DevEnvTag] = make(map[string]string, 0)
	EnvNodes[OnlineEnvTag] = make(map[string]string, 0)

	EnvNodes[TestEnvTag][TestServiceNodeOneTag] = TestServiceNodeOne
	EnvNodes[DevEnvTag][DevServiceNodeOneTag] = DevServiceNodeOne
	EnvNodes[OnlineEnvTag][OnlineServiceNodeOneTag] = OnlineServiceNodeOne
	EnvNodes[OnlineEnvTag][OnlineServiceNodeTwoTag] = OnlineServiceNodeTwo
	return EnvNodes
}

// EnvServiceNodeTags 环境对应的节点标识列表
func (s ServiceNodeEnums) EnvServiceNodeTags(envTag string) []string {
	nodeTagsMap := s.ServiceNodeTagMap()
	return nodeTagsMap[envTag]
}

// EnvServiceNodes 环境对应的节点列表
func (s ServiceNodeEnums) EnvServiceNodes(envTag string, nodeTag string) string {
	nodesMap := s.ServiceNodesMap()
	return nodesMap[envTag][nodeTag]
}
